//
//  DictionariesController.h
//  Words2
//
//  Created by Mathieu on 22/08/06.
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//

//consider renaming this class to DictProtocolDictionaryController
#import <Cocoa/Cocoa.h>
#import "DictionaryMO.h"
#import "LanguageMO.h"
#import <WebKit/WebKit.h>

@interface DictionariesController : NSObjectController {
	IBOutlet NSArrayController* languageController;
	IBOutlet NSArrayController* availableDictionaries;
	IBOutlet NSTextField* dictionaryName;
	IBOutlet NSTextField* server;
	IBOutlet NSTextField* database;
	IBOutlet NSTextField* username;
	IBOutlet NSTextField* password;
	IBOutlet NSTextField* targetLanguages;
//	IBOutlet NSTextField* pivotLanguage;
	IBOutlet NSTextField* capabilities;
	IBOutlet NSWindow* preferencesPane;
	IBOutlet NSTableView* availDictsView;
	IBOutlet NSTabView* mainWindowTabView;
	
	IBOutlet NSTextField* errorField;
	
	IBOutlet NSWindow* customDictPanel; //to enable closing of panel from the controller
	IBOutlet NSProgressIndicator *decompressionProgressIndicator;
	IBOutlet NSTextField *downloaderProgressMessage;

}

#pragma mark IBActions
- (IBAction)createNewDictionary:(id)sender;
- (IBAction)openDictionaryDownloaderView:(id)sender;


- (NSSet*)availableDictionaries;

//returns an array containing the types of dictionaries that are available.
- (NSArray *)supportedDictionaryTypes;

// Method which adds a dictionary to a language so that it is set to be used in defining words.
- (void)addDictionary:(DictionaryMO *)dictionary forUseInLanguage:(LanguageMO *)language;
- (IBAction)removeSelectedDictionaryFromMOC:(id)sender;


#pragma mark Import / Export Dictionaries
- (IBAction)exportDictionary:(id)sender;
- (IBAction)importDictionary:(id)sender;


-(void)didEnd:(NSSavePanel *)sheet
   returnCode:(int)code
  contextInfo:(void *)contextInfo;

@end
